package org.feiye.studyday16;

public class Custom {
	private String name;

	public Custom(String name) {
		this.name = name;
	}

	public Goods buy(int money) {
		if (money > 5000) {
			return new Tvs("液晶电视", 10000);
		} else if (money < 500) {
			return new Foods("零食大礼包", 50);
		}
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static void main(String[] args) {
		Custom c = new Custom("小王");
		System.out.println(c.buy(20));
	}
}
